<!DOCTYPE html>
<html>
<head>
    <title></title>
    <script type="text/javascript" src="../../../lib/qwrap-debug.js"></script>
</head>
<body style="height: 2000px; width: 2000px;">

<div id="div1" style="border: 5px solid #f00; width:200px; height: 300px; position:absolute; left:500px; top:200px;">
    <div id="div1_out" style="position:absolute;width:30px; border: 4px solid #ff0; height: 30px;">
        <div id="div1_in" style="width:20px; margin-left: 20px; padding-left: 30px; height: 30px; position:fixed;left:10px; top:20px; border: 2px solid #333;">

        </div>
    </div>


</div>
<div id="div2" style="border: 5px solid #f00; margin:40px 30px 30px 200px; width:200px; height: 300px; position:absolute; left:10px; top:200px;"></div>

<script type="text/javascript">
    //取得元素x坐标
    function pageX(elem) {
        return elem.offsetParent ? (elem.offsetLeft + pageX(elem.offsetParent)) : elem.offsetLeft;
    }
    //取得元素y坐标
    function pageY(elem) {
        return elem.offsetParent ? (elem.offsetTop + pageY(elem.offsetParent)) : elem.offsetTop;
    }
    /**
     *
     在firefox下，table /tr /td的border会忽略为0
     我下面的代码暂时未考虑的情况
     if (Browser.gecko) {
					if (/^t(?:able|d|h)$/i.test(node.tagName)) {
						t = l = 0;
					}
				}
     * @param el
     * @return {Number}
     */
    function pageX2(el){
        if(el.offsetParent){
            return el.offsetLeft + pageX2(el.offsetParent)+parseFloat(getComputedStyle(el.offsetParent).getPropertyValue('border-left-width'));
        }else{
            return el.offsetLeft;
        }
    }

    var div1=document.getElementById('div1');
    var div1_in=document.getElementById('div1_in');
    var div1_out=document.getElementById('div1_out');
    var div2=document.getElementById('div2');
</script>


</body>
</html>